Optimize pure C strings initialization.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jul 2012 08:43:46 +0000 (12:43 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jul 2012 08:43:46 +0000 (12:43 +0400)
commitfcc8fd3e10c992e083713481e2dc4fd3528f2c6b
treefa9b4e17c22264a229ee81f77210e9e763687d9c
parentf42de3b55a4479997db0f70f39ba91e50ce207ff
Optimize pure C strings initialization.
* lisp.h (make_pure_string): Fix prototype.
(build_pure_c_string): New function, defined as static inline.  This
provides a better opportunity to optimize away calls to strlen when
the function is called with compile-time constant argument.
* alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
argument, adjust users accordingly.  Use build_pure_c_string where
appropriate.
* buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
* keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
* xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
20 files changed:
src/ChangeLog
src/alloc.c
src/buffer.c
src/coding.c
src/data.c
src/dbusbind.c
src/fileio.c
src/fontset.c
src/frame.c
src/keyboard.c
src/keymap.c
src/lisp.h
src/lread.c
src/search.c
src/syntax.c
src/w32fns.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xterm.c